import csdj.t309.drive.entity.DriverSchool;
import csdj.t309.drive.service.DriverSchoolService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class test {
    @Test
    public void test(){
// 通过ClassPathXmlApplicationContext实例化Spring的上下文
        final ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-config.xml");
        // 从spring容器中取出已注入对象的 用户逻辑接口
        final DriverSchoolService driveSchoolService = applicationContext.getBean("driverSchoolService", DriverSchoolService.class);
        System.out.println("===============================================查询用户信息===============================================");
        List<DriverSchool> list = driveSchoolService.selectAll();
        for (DriverSchool l:list) {
            System.out.print(l.getAddress());
            System.out.print(l.getName());
            System.out.print(l.getcName());
            System.out.println();
        }
    }
}
